<?php

/**
 * Equipo filter form base class.
 *
 * @package    ehockey
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseEquipoFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'club_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Club'), 'add_empty' => true)),
      'sector'    => new sfWidgetFormChoice(array('choices' => array('' => '', 'Damas' => 'Damas', 'Caballeros' => 'Caballeros'))),
      'categoria' => new sfWidgetFormChoice(array('choices' => array('' => '', 'Primera' => 'Primera', 'Segunda' => 'Segunda', 'Tercera' => 'Tercera', 'Cuarta' => 'Cuarta', 'Quinta' => 'Quinta', 'Sexta' => 'Sexta', 'Septima' => 'Septima', 'Octava' => 'Octava', 'Novena' => 'Novena'))),
      'letra'     => new sfWidgetFormChoice(array('choices' => array('' => '', 'A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E', 'F' => 'F'))),
    ));

    $this->setValidators(array(
      'club_id'   => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Club'), 'column' => 'id')),
      'sector'    => new sfValidatorChoice(array('required' => false, 'choices' => array('Damas' => 'Damas', 'Caballeros' => 'Caballeros'))),
      'categoria' => new sfValidatorChoice(array('required' => false, 'choices' => array('Primera' => 'Primera', 'Segunda' => 'Segunda', 'Tercera' => 'Tercera', 'Cuarta' => 'Cuarta', 'Quinta' => 'Quinta', 'Sexta' => 'Sexta', 'Septima' => 'Septima', 'Octava' => 'Octava', 'Novena' => 'Novena'))),
      'letra'     => new sfValidatorChoice(array('required' => false, 'choices' => array('A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E', 'F' => 'F'))),
    ));

    $this->widgetSchema->setNameFormat('equipo_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Equipo';
  }

  public function getFields()
  {
    return array(
      'id'        => 'Number',
      'club_id'   => 'ForeignKey',
      'sector'    => 'Enum',
      'categoria' => 'Enum',
      'letra'     => 'Enum',
    );
  }
}
